package com.gxgeek.blockingqueue;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;

/**
 * @author gaoxing
 * @create 2017-12-22 上午11:43
 */
public class ArrayBlockingQueueTest {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> queue = new ArrayBlockingQueue<String>(1024);

        queue.put("1");

        System.out.println(queue.take());
        System.out.println(queue.poll(1, TimeUnit.NANOSECONDS));
    }
}
